package com.hsy.boot.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.stereotype.Repository;
import tk.mybatis.spring.annotation.MapperScan;

import java.net.InetAddress;

/**
 * 程序启动类
 *
 * @author huoshengyu
 * @version 1.0
 * @date 2020/3/28 10:19
 */
@Slf4j
@SpringBootApplication(scanBasePackages = "com.hsy.boot.service")
@ConfigurationPropertiesScan(basePackages = "com.hsy.boot.service.property")
@MapperScan(basePackages = "com.hsy.boot.service.mapper", annotationClass = Repository.class)
public class ApplicationRun implements ApplicationRunner {
    public static void main(String[] args) {
        SpringApplication.run(ApplicationRun.class, args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("程序已启动, 本机IP是[{}]", InetAddress.getLocalHost().getHostAddress());
    }
}
